package teamGiga.action;


import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sun.xml.internal.ws.api.ha.StickyFeature;

import teamGiga.bean.MovieMemberBean;
import teamGiga.bean.ShoppingBean;
import teamGiga.dao.CartDao;
import action.servlet.ActionForWard;

public class shoppinglistAction extends Action{	
	private String path;
	private boolean redirect;
	public String getPath() {
		return path;
	}
	public void setPath(String path) {
		this.path = path;
	}
	public boolean isRedirect() {
		return redirect;
	}
	public void setRedirect(boolean redirect) {
		this.redirect = redirect;
	}
	public shoppinglistAction(String path, boolean redirect) {
		super();
		this.path = path;
		this.redirect = redirect;
	}
	public shoppinglistAction() {
		super();
	}
	@Override
	public ActionForWard execute(HttpServletRequest request,
			HttpServletResponse response) {	
		try {
			MovieMemberBean bean=(MovieMemberBean) request.getSession().getAttribute("memberBean");
			int mbno=bean.getMbno();
			List<ShoppingBean>list=CartDao.selectshopping(mbno);
			request.setAttribute("Shoppinglist", list);			
			//System.out.println("shoppinglistActionmbno"+mbno);
			
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}	
		// TODO Auto-generated method stub
		return new  ActionForWard(path, redirect);
	}
	

	
}
